#include<sys/types.h>
#include<unistd.h>
#include<stdio.h>

int main(){
	pid_t pid;
	char * message;
	int n;
        printf("fork called :S :\n");
	pid=fork();
printf("This is the child's id:%d \n",pid );
	switch(pid){
		case -1: 
      perror("fork failed \n");
      exit(1);
		case 0:
      message ="This is the child \n";
      n=2;
      break;
      
default :
      message ="This is parent \n";
      n=3 ;
      break;
	}
//	 if (pid != 0)     printf("this is parent id:%d",pid);
	 for (;n>0; n--){
		 puts(message);
//		 sleep(1);
	 }
}
